package listener;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import dispatcher.DataDispatcher;

public class TextMouseListener implements MouseListener {
	
	private DataDispatcher dispatcher;
	private String name;
	
	public TextMouseListener(String name, DataDispatcher dispatcher) {
		this.dispatcher = dispatcher;
		this.name = name;
	}
	
	@Override
	public void mouseClicked(MouseEvent e) {
		try {
			this.dispatcher.writeTo(name, "hey");
		} catch (Exception e1) {
			throw new RuntimeException(e1);
		}
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

}
